<?php

namespace Sharks\Core\LifeCycle;

use Sharks\Core\Exception\ModelNotFoundException;
use Sharks\Core\Exception\RouteResolveException;

class DefaultErrorResolver extends ErrorResolver {

    public function resolve($response, $exception) {
        if (is_a($exception, RouteResolveException::class)
            || is_a($exception, ModelNotFoundException::class)) {

            return error(404);
        }
        return error(500);
    }
}